package com.example.object;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class District {
	ArrayList<Roads> lstRoads=new ArrayList<Roads>();

	public ArrayList<Roads> getLstRoads() {
		return lstRoads;
	}
	public void setLstRoads(ArrayList<Roads> lstRoads) {
		this.lstRoads = lstRoads;
	}
	public String getAction() {
		return Action;
	}
	public void setAction(String action) {
		Action = action;
	}
	public String getDescription() {
		return Description;
	}
	public void setDescription(String description) {
		Description = description;
	}
	public String getDistrict_ID() {
		return District_ID;
	}
	public void setDistrict_ID(String district_ID) {
		District_ID = district_ID;
	}
	public String getDistrict_Name() {
		return District_Name;
	}
	public void setDistrict_Name(String district_Name) {
		District_Name = district_Name;
	}
	public String getIsActive() {
		return IsActive;
	}
	public void setIsActive(String isActive) {
		IsActive = isActive;
	}
	public String getModifiedDate() {
		return ModifiedDate;
	}
	public void setModifiedDate(String modifiedDate) {
		ModifiedDate = modifiedDate;
	}
	public String getProvince_Code() {
		return Province_Code;
	}
	public void setProvince_Code(String province_Code) {
		Province_Code = province_Code;
	}
	public String getProvince_ID() {
		return Province_ID;
	}
	public void setProvince_ID(String province_ID) {
		Province_ID = province_ID;
	}
	public String getProvince_Name() {
		return Province_Name;
	}
	public void setProvince_Name(String province_Name) {
		Province_Name = province_Name;
	}
	public String getShort_Name() {
		return Short_Name;
	}
	public void setShort_Name(String short_Name) {
		Short_Name = short_Name;
	}
	String Action;
	String Description;
	String District_ID;
	String District_Name;
	String IsActive;
	String ModifiedDate;
	String Province_Code;
	String Province_ID;
	String Province_Name;
	String Short_Name;
	public static ArrayList<District> getListDistrict(String text) throws JSONException{
		ArrayList<District> lstDistrict=new ArrayList<District>();
		JSONArray jArr = new JSONArray(text);
		for (int i = 0; i < jArr.length(); i++) {
			JSONObject jObj = jArr.getJSONObject(i);
			District district=new District();
			district.setAction(jObj.getString("Action"));
			district.setDescription(jObj.getString("Description"));
			district.setDistrict_ID(jObj.getString("District_ID"));
			district.setDistrict_Name(jObj.getString("District_Name"));
			district.setIsActive(jObj.getString("IsActive"));
			district.setModifiedDate(jObj.getString("ModifiedDate"));
			district.setProvince_Code(jObj.getString("Province_Code"));
			district.setProvince_ID(jObj.getString("Province_ID"));
			district.setProvince_Name(jObj.getString("Province_Name"));
			district.setShort_Name(jObj.getString("Short_Name"));
			lstDistrict.add(district);		
		}
		return lstDistrict;
		
		
		
	}

}
